#!/bin/bash
function example_func() {
    param1=$1
    param2=$2

    if [ $param1 -gt $param2 ]
    then
        echo "参数1大于参数2"
        return 1
    elif [ $param1 -eq $param2 ]
    then
        echo "参数1等于参数2"
        return 0
    else
        echo "参数1小于参数2"
        return -1
    fi
}

echo "请输入两个数字："
read num1 num2
example_func $num1 $num2
result=$?
echo "函数返回值为：$result"